#ifndef GCSTRUCTS_H
#define GCSTRUCTS_H

#include <QString>
#include <Phonon/MediaSource>
#include <QImage>
#include <QColor>
#include <QList>
#include <QStringList>

/* GCProject structs */

typedef struct {
    int nodeId;

    QString name;
    int fps;
    QList<QImage> images;
} GCSprite;

typedef struct {
    int nodeId;

    QString name;
    bool repeat;
    qreal volume;
    Phonon::MediaSource media;
} GCSound;

typedef struct {
    int nodeId;

    QString name;
    QString datas;
} GCScript;

typedef struct {
    int nodeId;

    QString name;
    bool isColor; //true = Color, false = Image
    QColor color;
    QImage image;
    bool isRepeated; //if isColor = false, is the image repeated
} GCBackground;

typedef struct {
    int objId;
    int x;
    int y;
    int z;
} ObjPosXYZ;

typedef struct {
    int nodeId;

    QString name;
    int backgroundId;
    QList<ObjPosXYZ> objs;
} GCRoom;

/* Object, Actions & Events structs */

typedef struct {
    bool isText;
    QVariant dat;
} GCActionParam;

typedef struct {
    int type;
    QList<GCActionParam> params;
} GCAction;

typedef struct {
    int type;
    int persoId;
    int alarmId;
    QList<GCAction> actions;
    QList<GCActionParam> params;
} GCEvent;

typedef struct {
    int nodeId;

    QString name;
    bool solid;
    int spriteId;
    int parentId;
    QList<GCEvent> events;
} GCObject;

/* DataReatder structs */

enum EnumParamType {
    PT_BOOL,      /* C / C++ */
    PT_INT,
    PT_STRING,
    PT_FLOAT,
    PT_COMBO,
    PT_COLOR,     /* Game-Gen lib */
    PT_OBJECT,
    PT_SPRITE,
    PT_MUSIC,
    PT_SCRIPT,
    PT_BACKGROUND,
    PT_ROOM,
    PT_FONT
};

typedef struct {
    QString paramName;
    QString inCodeName;
    QString userData; //If paramType == PT_COMBO
    EnumParamType paramType;
} GCParamType;

typedef struct {
    int actionId;

    QString actionName;
    QList<GCParamType> actionParams;
    QString actionCode;
    QString requierements;
    QString init;

    int actionCategory;
    QString forcedIcon;
} GCActionType;

typedef struct {
    int eventId;

    QString eventName;
    int eventCategory;
    QString eventCodeAt;
    QString eventCode;
    QList<GCParamType> eventParams;
} GCEventType;

typedef struct {
    QString name;
    QString icon;
} GCCat;

#endif // GCSTRUCTS_H
